﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProductByParent.ascx.cs" Inherits="Usercontrol_ProductByParent" %>

<%@ Import Namespace="webapp4U" %>
<%@ Register Assembly="webapp4U" Namespace="webapp4U.UI" TagPrefix="webapp4U"  %>

<table align="center" width="100%" border="0">
    
    <tr>
        <td>
            <asp:Repeater runat="server" ID="rptCategory" onitemdatabound="rptCategory_ItemDataBound">
            <ItemTemplate>
                <tr>
                    <td >
                        <div class="labwell_title_page margin_bottom">                        
                            <h4><%# Eval("Description")%></h4>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td align="center">
                         <!-- Begin San Pham -->
                          <asp:DataList ID="ItemsDataList" runat="server" Width="100%" 
                          RepeatDirection="Horizontal" 
                          EnableViewState="False" 
                          DataSource='<%# GetItemsByCateID((string)Eval("InClassKey")) %>' 
                          CellPadding="0" 
                          ItemStyle-HorizontalAlign="left"
                          RepeatColumns="3" CssClass="table_product">
                           <ItemTemplate>
                            <table border="0" align="center" width="100%" style="height:100%;" >
                                <tr>
                                    <td class="BorderImage" width="140" height="140" align="center">
                                        <a href="<%=Globals.ApplicationPath %>Page/Products/ProductDetail.aspx?ItemKey=<%#Eval("ItemKey")%>">
                                            <img onmouseover="showtrail('<%=Globals.ApplicationPath %>Page/Products/Image.ashx?Size=L&ImageUrl=<%# Eval("ImageUrl") %>','<%# Eval("Description")%>',500,500)" onmouseout="hidetrail();" border="0" src='<%=Globals.ApplicationPath %>Page/Products/Image.ashx?Size=M&ImageUrl=<%# Eval("ImageUrl") %>' />                                 
                                            <br />
                                            <div class="product_tilte margin_bottom"><%# Eval("Description")%></div>
                                            <span class="product_price margin_bottom"> 
                                                <%=ResourceManager.GetString("Product_Price") %>: 
                                                <asp:Label ID="lblPrice" Text='<%#GetPrice((float)Eval("UnitPrice")) %>' runat="server" ></asp:Label>
                                            </span>                                        
                                        </a>
                                        <div class="margin_all">
                                            
                                              <webapp4U:Button runat="server" ID="btnProductOrder" Text="Đặt hàng" ResourceName="Product_Order" CssClass="bt_submit" OnClick="btn_ProductOrder_Click" />
                                              <webapp4U:Button ID="btnAddToCart" Text="Thêm vào giỏ hàng" ResourceName="Product_AddToCart" runat="server" CssClass="bt_submit" />
                                            <br />
                                            <asp:Panel runat="server" ID="PanelAddToCart">
                                                <input type="hidden" id="txtItemkey" value='<%#Eval("ItemKey")%>' runat="server" />
                                            </asp:Panel>
                                        </div>
                                    </td>
                                </tr>
                                
                            </table>
                        </ItemTemplate>
                          </asp:DataList>
                        <!-- End San Pham -->
                    </td>
                </tr>
                <tr>
                    <td align="right" style="padding-right: 20px; padding-bottom:3px;">
                        
                        <a class="ReadMore" href="<%=Globals.ApplicationPath%>Page/Products/Default.aspx?InClassKey=<%# Eval("InClassKey")%>">
                              <img src="<%=Globals.ImagesUrl()%>arrow.gif" />
                               <%=ResourceManager.GetString("ReadMore")%>
                        </a>
                    </td>
                </tr>
                <tr><td class="pm_line"></td></tr>
            </ItemTemplate>
            </asp:Repeater>
        </td>
    </tr>
</table>
<div align="center">
        <asp:Panel ID="DisplayPager" Visible="True" runat="server">
            <div align="center">
                <table cellpadding="2" cellspacing="0" border="0" width="100%" align="center">
                    <tr>
                        <td valign="middle" align="center">
                            <webapp4U:Pager ID="Pager" runat="server" />
                        </td>
                    </tr>
                </table>
            </div>
        </asp:Panel>
    </div>